// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   MenuBindNavDTO.java

package com.hfstu.ifs.dto;

import com.hfstu.framework.util.StringUtil;
import com.hfstu.ifs.model.*;
import java.lang.reflect.InvocationTargetException;
import org.apache.commons.beanutils.BeanUtils;

public class MenuBindNavDTO
{

	private String id;
	private String menuId;
	private String menuName;
	private String navControlId;
	private String navControlName;
	private String navControlType;
	private String showNavName;
	private Integer orderIndex;

	public MenuBindNavDTO()
	{
	}

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public String getMenuId()
	{
		return menuId;
	}

	public void setMenuId(String menuId)
	{
		this.menuId = menuId;
	}

	public String getMenuName()
	{
		return menuName;
	}

	public void setMenuName(String menuName)
	{
		this.menuName = menuName;
	}

	public String getNavControlId()
	{
		return navControlId;
	}

	public void setNavControlId(String navControlId)
	{
		this.navControlId = navControlId;
	}

	public String getNavControlName()
	{
		return navControlName;
	}

	public void setNavControlName(String navControlName)
	{
		this.navControlName = navControlName;
	}

	public String getShowNavName()
	{
		return showNavName;
	}

	public void setShowNavName(String showNavName)
	{
		this.showNavName = showNavName;
	}

	public Integer getOrderIndex()
	{
		return orderIndex;
	}

	public void setOrderIndex(Integer orderIndex)
	{
		this.orderIndex = orderIndex;
	}

	public String getNavControlType()
	{
		return navControlType;
	}

	public void setNavControlType(String navControlType)
	{
		this.navControlType = navControlType;
	}

	public MenuBindNavDTO transfer(MenuBindNav menuBindNav)
	{
		try
		{
			BeanUtils.copyProperties(this, menuBindNav);
		}
		catch (IllegalAccessException e)
		{
			e.printStackTrace();
		}
		catch (InvocationTargetException e)
		{
			e.printStackTrace();
		}
		if (menuBindNav.getMenu() != null)
		{
			setMenuId(menuBindNav.getMenu().getId());
			setMenuName(menuBindNav.getMenu().getName());
		}
		if (menuBindNav.getNavControl() != null)
		{
			setNavControlId(menuBindNav.getNavControl().getId());
			setNavControlName(menuBindNav.getNavControl().getName());
			setNavControlType(menuBindNav.getNavControl().getNavControlType());
		}
		return this;
	}

	public String toJson()
	{
		StringBuilder json = new StringBuilder();
		json.append("{");
		json.append("\"id\":\"").append(getId()).append("\",");
		json.append("\"showNavName\":\"").append(getShowNavName()).append("\",");
		json.append("\"orderIndex\":").append(getOrderIndex()).append(",");
		json.append("\"menuId\":\"").append(getMenuId()).append("\",");
		json.append("\"menuName\":\"").append(StringUtil.clean(getMenuName())).append("\",");
		json.append("\"navControlId\":\"").append(StringUtil.clean(getNavControlId())).append("\",");
		json.append("\"navControlName\":\"").append(StringUtil.clean(getNavControlName())).append("\",");
		json.append("\"navControlType\":\"").append(StringUtil.clean(getNavControlType())).append("\"");
		json.append("}");
		return json.toString();
	}
}
